/*
 * Object.java
 *
 * Created on December 12, 2007, 3:27 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package editor;

import java.awt.Graphics;
import java.awt.geom.Point2D;

/**
 *
 * @author demo
 */
public interface Object {
    /**
     * Redraw this object
     */
    public void draw(Graphics g);
    /**
     * returns Object type: 
     * 0 - polygon
     * 1 - line
     * 2 - circle
     * 3 - oriented point
     * @return object type
     */
    public int getType();
    /**
     * If the given point is on the object, the object will be selected
     * @return True if the object has been selected
     */
    public boolean doSelected(int x, int y);
    /**
     * Drag the nearby point
     */
    public void doDragged(int x, int y);
    /**
     * Called when the mouse is released and this object was selected
     */
    public void doReleased();
    /**
     * Unselect the current object
     */
    public void unselect();
    /**
     * 
     * @return Returns true if this object is selected
     */
    public boolean isSelected();
    /**
     * Set scaling of the object pixel -> meters transformation
     */
    public void setScale(float scaleX, float scaleY);
    /**
     * Sets ObjectInfo class
     * @param i ObjectInfo class
     */
    public void setInfo(ObjectInfo i);
    /**
     * Get info
     * @return Returns reference to ObjectInfo class
     */
    public ObjectInfo getInfo();
    /**
     * Returns String with SDO_GEOM syntax to be inserted into DB
     * @return String with SDO syntax
     */
    public String getGeom();
    /**
     * Set this object as selected
     */
    void select();
    /**
     * Selected ?
     * @return Returns true if this object is complete and can be added into scene
     */
    boolean isComplete();

    /**
     * Adds point into the object
     */
    void addPoint(int i, int i0);

    /**
     * Finds out if a point can be added to the object
     * @return true if can add, false otherwise
     */
    boolean canAdd();

    /**
     * Add point to the object, coordinates are in meters
     */
    void addPoint(Point2D aDouble);
}
